Ext.define('Hr.view.staff.staffinfo.EditWindow',{
    extend:'Ext.window.Window',
    alias:'widget.edit',
    width:560,
    height:470,
    renderTo:Ext.getBody(),
    modal:true,
    resizable:false,
    layout:'fit',
    bodyStyle:'background-color:white;background-image:none',
    title:'个人信息编辑',
    items:[{
        xtype:'form',
        id:'form',
        border:false,
        autoScroll:true,
        margin:15,
        items:[{
            xtype:'textfield',
            name:'personPhoto',
            id:'personPhoto',
            hidden:true
        },{
	        xtype:'fieldset',
            title:'基本信息',
	        layout:{
	            type: 'table',
	            columns: 3
	        },
            defaults:{
                xtype:'textfield',
                labelWidth: 70,
                width:200,
                margin:3
            },
            items:[{
                name:'id',
                id:'id',
                hidden:true
            },{
                fieldLabel:'姓名',
                name:'name',
                allowBlank:false,
                blankText:'“姓名”必须填写',
                emptyText:'请填写'
            },{
                xtype:'combo',
                fieldLabel:'性别',
                name:'sex',
                store:'staff.SexStore',
                displayField:'name',
                valueField:'value',
                allowBlank:false,
                blankText:'“性别”必须填写',
                emptyText:'请选择',
                editable:false
            },{//头像
                xtype:'image',
                id:'image',
                src:'../image/defult_photo.png',
                width:80,
                height:100,
                rowspan:4
            },{
                xtype:'datefield',
                name:'birth',
                fieldLabel:'出生日期',
                allowBlank:false,
                blankText:'“出生日期”必须填写',
                emptyText:'请填写'
            },{
                fieldLabel:'籍贯',
                name:'hometown'
            },{
                xtype:'combo',
                fieldLabel:'学历',
                name:'education',
                store:'staff.EducationStore',
                displayField:'name',
                valueField:'value',
                editable:false
            },{
                fieldLabel:'专业',
                name:'major'
            },{
                fieldLabel:'就读院校',
                name:'school'
            },{
            	fieldLabel:'职务',
                name:'duty'
            }]
	    },{
            xtype:'fieldset',
            title:'进阶信息',
            layout:{
                type: 'table',
                columns: 2
            },
            defaults:{
                xtype:'textfield',
                labelWidth: 100,
                width:230,
                margin:3
            },
            items:[{
                xtype:'datefield',
                fieldLabel:'入职时间',
                allowBlank:false,
                blankText:'“出生日期”必须填写',
                emptyText:'请填写',
                name:'joinTime'
            },{
                fieldLabel:'紧急联系人',
                name:'urgenPerson'
            },{
                fieldLabel:'身份证号码',
                name:'idNumber'
            },{
                fieldLabel:'紧急联系人电话',
                name:'urgenPhone'
            },{
                fieldLabel:'联系电话',
                name:'phone'
            },{
                xtype:'combo',
                fieldLabel:'在职状态',
                name:'state',
                store:'staff.StateStore',
                displayField:'name',
                valueField:'value',
                allowBlank:false,
                blankText:'“在职状态”必须填写',
                editable:false,
                emptyText:'请选择'
            }]
        },{
            xtype:'fieldset',
            title:'资料上传',
            layout:{
                type: 'table',
                columns: 2
            },
            defaults:{
                margin:3,
                labelWidth:60,
                width:230
            },
            items:[{
                xtype:'fileuploadfield',
                id:'photo',
                name:'photo',
                fieldLabel:'上传照片',
                buttonText:'上传照片'
            },{
                xtype:'fileuploadfield',
                id:'code',
                name:'code',
                fieldLabel:'上传证件',
                buttonText:'上传证件'
            }]
        
        },{
            xtype:'textfield',
            hidden:true,
            id:'photoName',
            name:'photoName'
        },{
            xtype:'textfield',
            id:'cert',
            name:'cert',
            hidden:true
        }]
    }],
   buttons:[{
            text:'完成',
            action:'submit',
            icon:'../image/icons/submit.png'
        },{
            text:'取消',
            id:'cancel',
            handler:function(obj){
                Ext.MessageBox.show({
                    title:'警告',
                    msg:'该操作不会保存任何数据，确定取消？',
                    buttons:Ext.Msg.YESNO,
                    icon:Ext.Msg.WARNING,
                    fn:function(is){
                        if(is=="yes"){
                            obj.up('edit').close();
                        }
                    }
                });
        	},
            icon:'../image/icons/cancel.png'
        }]
    
})